package com.haiqi.modules.main.web;

import com.haiqi.common.annotation.SafeAuthority;
import com.haiqi.modules.main.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * Created by hythzx on 2016/5/20.
 */
@Controller
@RequestMapping("/manage/user")
@SafeAuthority(menuCode = "fleetManage")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/logout")
    public String logout(HttpSession session, Model model){
        session.removeAttribute("user");
        session.removeAttribute("menu");
        session.removeAttribute("token");
        model.addAttribute("errorMsg","");
        return "modules/user/login";
    }


}
